{% extends "base.html" %}

{% block head %}
	<link type="text/css" rel="stylesheet" href="stylesheets/main.css" />
{% endblock head %}

{% block nav %}
	<p><a href="/new-category">New Category</a></p>
{% endblock nav %}

{% block content %}
	<table border="1">
		<tr>
			<td>Name</td>
			<td>Description</td>
			<td>User</td>
		</tr>
		{% for category in categories %}
		<tr>
			<td><a href="/category?id={{ category.key }}">{{ category.name }}</a></td>
			<td>{{ category.description }}</td>
			<td>{{ category.owner }}</td>
			<td><a href="/edit-category?id={{ category.key }}">Edit</a>
			<td><a href="/delete-category?category={{ category.key }}" 
				   onclick="return confirm('Are you sure you want to delete category &quot;{{ category.name }}&quot; and all its cards?')">Delete</a></td>
		</tr>
		{% endfor %}
	</table>
{% endblock content %}
